// pages/my/invitelist/invitelist.js
Page({
  data: {
    list: [],
    count: 0,
    page: 1,
    size: 20,
    isNoMore: true,
    isLoding: true
  },
  onLoad(options) {
    this.getData();
  },
  getData() {
    let params = {
      page: this.data.page,
      size: this.data.size,
    };
    getApp().globalData.http.inviteList(params).then(res => {
      let data_tmp = [...this.data.list, ...res.data];
      this.setData({
        list: data_tmp,
        count: res.count,
        isLoding: true
      });
      if (this.data.list.length == res.count) {
        this.setData({
          isNoMore: false
        });
      }
    });
  },
  onReachBottom() {
    if (this.data.isNoMore) {
      this.setData({
        page: this.data.page / 1 + 1,
        isLoding: false
      });
      this.getData();
    }
  },
})